package com.ruoyi.tea.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tea.mapper.TeaHelpMapper;
import com.ruoyi.tea.domain.TeaHelp;
import com.ruoyi.tea.service.ITeaHelpService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客服相关信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-31
 */
@Service
public class TeaHelpServiceImpl implements ITeaHelpService 
{
    @Autowired
    private TeaHelpMapper teaHelpMapper;

    /**
     * 查询客服相关信息
     * 
     * @param id 客服相关信息主键
     * @return 客服相关信息
     */
    @Override
    public TeaHelp selectTeaHelpById(Long id)
    {
        return teaHelpMapper.selectTeaHelpById(id);
    }

    /**
     * 查询客服相关信息列表
     * 
     * @param teaHelp 客服相关信息
     * @return 客服相关信息
     */
    @Override
    public List<TeaHelp> selectTeaHelpList(TeaHelp teaHelp)
    {
        return teaHelpMapper.selectTeaHelpList(teaHelp);
    }

    /**
     * 新增客服相关信息
     * 
     * @param teaHelp 客服相关信息
     * @return 结果
     */
    @Override
    public int insertTeaHelp(TeaHelp teaHelp)
    {
        teaHelp.setCreateTime(DateUtils.getNowDate());
        return teaHelpMapper.insertTeaHelp(teaHelp);
    }

    /**
     * 修改客服相关信息
     * 
     * @param teaHelp 客服相关信息
     * @return 结果
     */
    @Override
    public int updateTeaHelp(TeaHelp teaHelp)
    {
        return teaHelpMapper.updateTeaHelp(teaHelp);
    }

    /**
     * 批量删除客服相关信息
     * 
     * @param ids 需要删除的客服相关信息主键
     * @return 结果
     */
    @Override
    public int deleteTeaHelpByIds(String ids)
    {
        return teaHelpMapper.deleteTeaHelpByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除客服相关信息信息
     * 
     * @param id 客服相关信息主键
     * @return 结果
     */
    @Override
    public int deleteTeaHelpById(Long id)
    {
        return teaHelpMapper.deleteTeaHelpById(id);
    }

    @Override
    public TeaHelp oneHelp() {
        return teaHelpMapper.oneHelp();
    }
}
